//
//  ViewController.swift
//  date
//
//  Created by zhangguo on 15/10/25.
//  Copyright © 2015年 zhangguo. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

        override func viewDidLoad() {
            super.viewDidLoad()
            
            
            print(NSDate.sinaDate("Sun Oct 25 20:11:00 +0800 2015")?.dateDesctiption)
               print(NSDate.sinaDate("Sun Oct 24 12:12:00 +0800 2015")?.dateDesctiption)
               print(NSDate.sinaDate("Sun May 25 12:12:00 +0800 2015")?.dateDesctiption)
               print(NSDate.sinaDate("Sun May 25 12:12:00 +0800 2015")?.dateDesctiption)
               print(NSDate.sinaDate("Sun May 25 12:12:00 +0800 2013")?.dateDesctiption)
        }
        
        func demo() {
            let string = "Sun Oct 25 12:12:00 +0800 2015"
            
            //转换日期
            let df = NSDateFormatter()
            
            df.locale = NSLocale(localeIdentifier: "en")
            
            df.dateFormat = "EEE MMM dd HH:mm:ss zzz yyyy"
            
            //转换成日期
            let date = df.dateFromString(string)
            
        }

    }

